//
//  CustomCell.m
//  DemoTableView
//
//  Created by admin on 8/1/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "CustomCell.h"

@implementation CustomCell
@synthesize primaryLabel,secondaryLabel,myImageView;
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier]) {
        // Initialization code
        primaryLabel = [[UILabel alloc]init];
        primaryLabel.textAlignment = UITextAlignmentLeft;
        primaryLabel.font = [UIFont systemFontOfSize:20];
        [primaryLabel setTextColor:[UIColor whiteColor]];
        [primaryLabel setBackgroundColor:[UIColor clearColor]];
        [self.contentView addSubview:primaryLabel];
//        secondaryLabel = [[UILabel alloc]init];
//        secondaryLabel.textAlignment = UITextAlignmentLeft;
//        secondaryLabel.font = [UIFont systemFontOfSize:8];
//        myImageView = [[UIImageView alloc]init];
//       [self.contentView addSubview:primaryLabel];
//       [self.contentView addSubview:secondaryLabel];
//       [self.contentView addSubview:myImageView];        
//       [secondaryLabel setBackgroundColor:[UIColor clearColor]];
//       [myImageView setBackgroundColor:[UIColor clearColor]];
        
    }
    return self;
}
- (void)layoutSubviews {
    [super layoutSubviews];
    CGRect contentRect = self.contentView.bounds;
    CGFloat boundsX = contentRect.origin.x;
    CGRect frame;
//    frame= CGRectMake(boundsX+10 ,0, 50, 50);
//    myImageView.frame = frame;
    
    frame= CGRectMake(boundsX+10 ,20, 480, 24);
    primaryLabel.frame = frame;
    
//    frame= CGRectMake(boundsX+70 ,30, 100+60, 15);
//    secondaryLabel.frame = frame;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state
}
-(void)dealloc
{
    [super dealloc];
    SAFE_RELEASE(primaryLabel);
     SAFE_RELEASE(secondaryLabel);
     SAFE_RELEASE(myImageView);
}
@end
